package com.system.animal.utils;

public class R<T> {
    private int code;
    private String message;
    private T data;

    private R(int code, String message, T data){
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static <T> R<T> success(String msg,T data){
        return new R<T>(200,msg,data);
    }
    public static <T> R<T> success(String msg){
        return new R<T>(200,msg,null);
    }
    public static <T> R<T> filed(int code,String msg){
        return new R<T>(code,msg,null);
    }
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getdata() {
        return data;
    }

    public void setdata(T data) {
        this.data = data;
    }
}
